﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    public class MovieProxy : Movie
    {
        private MoveIntercept _interceptor = new MoveIntercept();
        private Movie _beproxy = new Movie();
        public override void Test()
        {
            try
            {

                TransitionManage.StartTransition();
                object[] parameters = new object[0];
                this._interceptor.Before(this, "Test", parameters);
                DateTime start = DateTime.Now;

                base.Test();

                DateTime end = DateTime.Now;
                object result = null;
                this._interceptor.After(this, "Test", result, start, end);
                TransitionManage.DoCommit();
            }
            catch (Exception)
            {
                TransitionManage.DoRollBack();
                throw;
            }
        }
        public override T Test1<T>()
        {
            try
            {
                TransitionManage.StartTransition();
                object[] parameters = new object[0];
                this._interceptor.Before(this, "Test1", parameters);
                DateTime start = DateTime.Now;
                object obj = base.Test1<T>();
                DateTime end = DateTime.Now;
                this._interceptor.After(this, "Test1", obj, start, end);
                TransitionManage.DoCommit();
                return (T)((object)obj);
            }
            catch (Exception)
            {
                TransitionManage.DoRollBack();
                throw;
            }
        }
    }
}
